﻿<?php
$tab = "friendlist";
require_once "config.php";
require_once "dbconfig.php";
require_once "tab.inc.php";
//if(!function_exists('curl_init')){
//die('这个主机目前不支持GD模块');
//}
$url = "http://api.xiaonei.com/restserver.do?format=JSON&api_key=".$apiKey
		."&method=xiaonei.friends.get&session_key=".urlencode($sk)
		."&v=1.0";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$rt = curl_exec($ch);
curl_close($ch);
$temp = htmlspecialchars($rt);
$xmlHelper = new XMLHelper($temp);
#echo $xmlHelper->getXMLNodeValue("sex",false)."<br>";
$uidsString = $xmlHelper->getXMLDuilpNodeValue("uid");

 $sqlQuery = "select * from app_pp_user_health where status = '1' and out_id in (".$uidsString.") order by healthy_index desc";
 $result = mysql_db_query($database, $sqlQuery);
?>
 <div style="float:left;margin:2px;width:600px;border:1px solid #e5f0f8;">
<?php
 while($row = mysql_fetch_object($result)){
?>
		<div style="margin:1px;border-bottom:1px #ccc dashed;">
		<div style="float:left;margin:6px;border-bottom:0px #ccc dashed;"><a href="http://xiaonei.com/getuser.do?id=<?php echo $row->out_id ?>"><img src="<?php echo $row->head_url;?>"/></a></div>
		<div style="float:left;margin:4px;border-bottom:0px #ccc dashed;">
			    BMI： <?php echo $row->healthy_index;?> <br/>
				姓名：<a href="http://xiaonei.com/getuser.do?id=<?php echo $row->out_id ?>"><?php echo $row->user_name;?></a> <br/>
				大学：<?php echo $row->university_name;?><br/>
				公司：<?php echo $row->company_name;?>
              </div>
              <div style="clear:both"></div>
        </div>
<?php } ?>
</div>